package com.yjd.comm.project.service;

import com.yjd.comm.base.model.PagerModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.project.model.ProjectModel;
import com.yjd.comm.project.model.ProjectRateConfig;
import com.yjd.comm.project.model.ProjectShowInfo;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：项目业务接口<br>
 * <b>time</b>：2017-06-27 08:55:08 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IProjectService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ProjectModel insert(ProjectModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(ProjectModel model) throws Exception;

	/**
	 * 创建或者更新,大于等于1表示成功，其他失败
	 *
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int createOrUpdate(ProjectModel model, String projectDetail, String[] tags) throws Exception;

	/**
	 * 更具projectId更新对应项目,大于等于1表示成功，其他失败
	 *
	 * @param projectId
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public int updateById(Long projectId, Map<Object, Object> paramMap) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param project_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long project_id) throws Exception;


	/**
	 * 搜索项目
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public PagerModel getProjectListByKeys(Map<String, Object> param) throws Exception;


	/**
	 * 查询多个项目 根据idlist
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public Map<Long,ProjectShowInfo> getProjectInfoList(List<Long> list) throws Exception;


	public int updateByMap(Map<Object,Object> param)throws Exception;


	/**
	 * 根据queryParamMap条件查询项目，可支持分页
	 * @param queryParamMap
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> queryProject(Map<String, Object> queryParamMap) throws Exception;

	/**
	 * 将Project转换的ResultMap
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> transformProjectToMap(ProjectModel model) throws Exception;


	/**
	 * 商户上架项目
	 * @param project_id
	 * @return
	 * @throws Exception
	 */
	public int openProject(Long org_id,Long project_id)throws Exception;

	/**
	 * 商户下架项目
	 * @param project_id
	 * @return
	 * @throws Exception
	 */
	public int colseProject(Long org_id,Long project_id)throws Exception;


	/**
	 * 商户修改价格
	 * @param project_id
	 * @param project_price 项目原价
	 * @param act_price 实际售卖价格
	 * @param payment 首付金额
	 * @return
	 * @throws Exception
	 */
	public int updateProjectPrice(Long org_id,Long project_id,Double project_price,Double act_price,Double payment,ProjectRateConfig projectRateConfig)throws Exception;


	/**
	 * 商户修改利率配置
	 * @param project_id
	 * @return
	 * @throws Exception
	 */
	public int updateProjecRate(Long org_id,Long project_id,ProjectRateConfig config)throws Exception;

}
